package com.jusyl.cristo.spider.lianjia;

import us.codecraft.webmagic.Site;
import us.codecraft.webmagic.model.ConsolePageModelPipeline;
import us.codecraft.webmagic.model.OOSpider;
import us.codecraft.webmagic.model.annotation.ExtractBy;
import us.codecraft.webmagic.model.annotation.HelpUrl;
import us.codecraft.webmagic.model.annotation.TargetUrl;

@TargetUrl("https://bj.lianjia.com/ershoufang/rs%E4%B8%89%E7%8E%AF%E6%96%B0%E5%9F%8E/")
@HelpUrl("https://bj.lianjia.com/ershoufang/pg*rs%E4%B8%89%E7%8E%AF%E6%96%B0%E5%9F%8E/")
public class WebMagicLianJiaModel2 {
	@ExtractBy("//li[@class='title']/a/text()")
	private String id;
	private String title;
	private String xiaoQu;
	private String huXing;
	private String mianJi;
	private String chaoXiang;
	private String danJia;
	private String zongJia;
	private String louCeng;
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getXiaoQu() {
		return xiaoQu;
	}
	public void setXiaoQu(String xiaoQu) {
		this.xiaoQu = xiaoQu;
	}
	public String getHuXing() {
		return huXing;
	}
	public void setHuXing(String huXing) {
		this.huXing = huXing;
	}
	public String getMianJi() {
		return mianJi;
	}
	public void setMianJi(String mianJi) {
		this.mianJi = mianJi;
	}
	public String getChaoXiang() {
		return chaoXiang;
	}
	public void setChaoXiang(String chaoXiang) {
		this.chaoXiang = chaoXiang;
	}
	public String getDanJia() {
		return danJia;
	}
	public void setDanJia(String danJia) {
		this.danJia = danJia;
	}
	public String getZongJia() {
		return zongJia;
	}
	public void setZongJia(String zongJia) {
		this.zongJia = zongJia;
	}
	public String getLouCeng() {
		return louCeng;
	}
	public void setLouCeng(String louCeng) {
		this.louCeng = louCeng;
	}
	
	public static void main(String arg[]) {
		OOSpider.create(Site.me().setSleepTime(1000), 
						new ConsolePageModelPipeline(), 
						WebMagicLianJiaModel2.class).addUrl("https://bj.lianjia.com/ershoufang/rs%E4%B8%89%E7%8E%AF%E6%96%B0%E5%9F%8E/").thread(1).run();
		
	}
}
